#!/bin/sh

# must not fail
set -e 

# debug
set -x 

echo "Starting $0"


MOPS_DISTNAME=mops-id_ejbca.zip
MOPS_DIRNAME=mops-id_ejbca
MOPS_UNPACKCMD=unzip


### copy to "install"

if [ ! -f ${DISTFILES_INSTALL}/${MOPS_DISTNAME} ] ; then 	
    echo "copying ${MOPS_DISTNAME} to ${DISTFILES_INSTALL}"
    cp ${MOPS_DISTNAME}     ${DISTFILES_INSTALL}
fi

### unpack if this version dont exist already
if [ -x ${INSTALL_INTO}/${MOPS_DIRNAME} ] ;then
    echo "${MOPS_DIRNAME} exists, skipping"
else
    cd ${INSTALL_INTO}
    ${MOPS_UNPACKCMD} ${DISTFILES_INSTALL}/${MOPS_DISTNAME} 
    cd -
fi

echo "End of $0"

